Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support workspaces #100

Closed
wants to merge 6 commits into from
Closed

Conversation

WataruNishimura
Copy link

Relative issues

#96 (I submitted this issue)

What I did

  • Implementing findPnpmWorkspaceYaml() to find pnpm-workspace.yaml
    • if pnpm finds this, pnpm recognize as workspace root the directory even the file is empy.
  • Implementing passing pnpm workspace option -w to installSyncSaveDev()
    • Simple ternaly operator implemention.

@eslint-github-bot
Copy link

Hi @WataruNishimura!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

Copy link

linux-foundation-easycla bot commented Apr 17, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@WataruNishimura WataruNishimura changed the title Implementing pnpm workspace applied dependency install fix: Implementing pnpm workspace applied dependency install Apr 17, 2024
@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Apr 17, 2024
Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be a new feat: support workspaces, than a bugfix.

can you also add support for npm/yarn/bun?

@WataruNishimura
Copy link
Author

I think it should be a new feat: support workspaces, than a bugfix.

can you also add support for npm/yarn/bun?

Thanks for comments!

Sure I'll try it.

@WataruNishimura WataruNishimura changed the title fix: Implementing pnpm workspace applied dependency install feat: support workspaces Apr 18, 2024
@WataruNishimura WataruNishimura marked this pull request as draft April 18, 2024 04:14
@@ -39,20 +39,45 @@ function findPackageJson(startDir) {
return null;
}

/**
Copy link
Member

@aladdin-add aladdin-add Apr 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can write this as a function(possible isRootWorkspace()), something like:

function isRootWorkspace(packageJsonPath){
  const pkg = JSON.parse(...)
  if(pkg.private === true && pkg.workspaces !== void 0) return true;
  return fs.existsSync(path.join(packageJsonPath, "../pnpm-workspace.yaml");
}

it can be evalutated in the constructor, so you can just use it when you need it:

this.isRootWorkspace = isRootWorkspace();

@aladdin-add
Copy link
Member

@WataruNishimura are you still working on this?

@aladdin-add
Copy link
Member

Closing because there hasn't been activity for 30 days. If you're still interested in submitting this code, please feel free to resubmit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants